package cn.stylefeng.guns.modular.gridsystem.mapper;

import cn.stylefeng.guns.modular.gridsystem.model.param.BizExceptionLogParam;
import cn.stylefeng.guns.modular.gridsystem.model.result.BizExceptionLogResult;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.stylefeng.guns.modular.gridsystem.entity.BizExceptionLog;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * 故障明细表 Mapper 接口
 *
 * @author ssy
 * @date 2021/09/14 11:47
 */
public interface BizExceptionLogMapper extends BaseMapper<BizExceptionLog> {

    Page<Map<String, Object>> pageList(Page page, @Param("param") BizExceptionLogParam param, @Param("ew") QueryWrapper<BizExceptionLog> ew);

    Page<BizExceptionLogResult> thirdPageList(Page page, @Param("param") BizExceptionLogParam param, @Param("ew") QueryWrapper<BizExceptionLog> ew, @Param("deviceId") Integer deviceId);

    List<Map<String, Object>> thirdList(@Param("param") BizExceptionLogParam param, @Param("ew") QueryWrapper<BizExceptionLog> ew, @Param("deviceId") Integer deviceId);

    BizExceptionLogResult getExceptionLog(@Param("eId") Integer eId);

    List<Map<String, Object>> getAllExceptionGroup();

    List<Map<String, Object>> getList(@Param("gatewayCodes") ArrayList<String> gatewayCodes);

    Map<String, Object> getChannelNewfaultFile(@Param("gatewayCode") String gatewayCode, @Param("gatewayChannel") String gatewayChannel);

    List<Map<String, Object>> groupByRouterList(@Param("deviceId") Integer deviceId);

    List<String> getExceptionLately(Integer deviceId);
}
